<template>
  <router-link
    v-if="menu.children.length === 0"
    class="ivu-menu-item"
    :to="menu.url" tag="li"
    :key="menu.id">
    <Icon :type="menu.icon"></Icon>
    {{menu.title}}
  </router-link>
  <Submenu v-else :name="menu.title">
    <template slot="title">
      <Icon type="ios-paper"></Icon>
      {{menu.title}}
    </template>
    <nav-menu-item v-for="item in menu.children" :menu="item" :key="menu.id"></nav-menu-item>
  </Submenu>
</template>
<script type="text/ecmascript-6">
  export default{
    name: 'nav-menu-item',
    components: {},
    props: ['menu'],
    data () {
      return {

      }
    }
  }
</script>
<style lang="less">
</style>
